import Vue from 'vue'   //引入Vue
import VueRouter from 'vue-router'
import loginPage from "@/view/loginPage";
import manggerCenter from "@/view/manggerCenter";
import {globalValue} from "@/config/globalconfig";
import {adminMain} from "@/router/adminMain";
//引入vue-router

Vue.use(VueRouter)  //Vue全局使用Router
const router = new VueRouter({
    mode:'history',//去除#号
    routes: [              //配置路由，这里是个数组
        {   //配置默认路由
            path:'/',
            redirect:'/docPage',
            component: manggerCenter,
            meta:{
                title:globalValue.protectTitle()+globalValue.protectTitle,
                mustLogin:true
            }
        },
        {
            path:'/login',
            component:loginPage,
            meta:{
                title:globalValue.protectTitle()+globalValue.protectTitle+'用户登录'
            }
        },
        // {
        //     path:'/loginpage',
        //     component:loginPage,
        //     meta:{
        //         title:globalValue.protectTitle(),
        //         mustLogin:true
        //     }
        // },
        {
            path:'/manggerCenter',
            component: manggerCenter,
            meta:{
                title:globalValue.protectTitle,
                mustLogin:true
            },
            children:adminMain
        },
    ]
});
export default router;
